import React, { Component } from 'react'
import { context } from '../context'
// 哪个组件要接收数据,就使用context.Consumer
export default class Son extends Component {
  render() {
    return (
      <context.Consumer>
        {(data) => {
          return (
            <div>
              <h1>Son</h1>
              <p>{data}</p>
            </div>
          )
        }}
      </context.Consumer>
    )
  }
}
